<?php
class padImeiAction extends backendAction
{
    public function _initialize() {
        parent::_initialize();
        $this->_name = 'pad_imei';
        $this->_mod = D('pad_imei');
    }
    public function _before_index() {  
       $this->list_relation = true;
       $this->assign('type',$_REQUEST['type']);

    }
    /**
     * 获取请求参数生成条件数组
     */
    protected function _search() {
        //生成查询条件       
        ($imei = $this->_request('imei', 'trim')) && $map['imei'] = array('like', '%'.$imei.'%');        
        $this->assign('search', array(
            'imei'=>$imei,
        ));  
       if($_REQUEST['type']=='ajax'){
         $map['userId'] = "0"; 
       }        
                   
        return $map;
    }
    
    
    public function index_ajax(){
        
        $map = $this->_search();
        $map['userId'] = "0"; 
        $mod = D($this->_name);
        !empty($mod) && $this->_list($mod, $map);
        $this->assign('type','ajax');
        //$response = $this->fetch();
        //$this->ajaxReturn(1, '', $response);
        $this->display();        
    }
}

?>